package com.sztx.pay.center.dataaccess.dao.mysql;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.sztx.pay.center.dataaccess.domain.PayFlowDO;
import com.sztx.pay.center.dataaccess.domain.PlatformTradeFlowDO;
import com.sztx.pay.center.dataaccess.domain.UserBindCardDO;
import com.sztx.se.dataaccess.mysql.BaseMysqlDAO;
import com.sztx.se.dataaccess.mysql.config.PageQuery;

public interface PayFlowMysqlDAO extends BaseMysqlDAO<PayFlowDO> {

	Integer save(PayFlowDO payFlowDO);

	void delete(@Param("payFlowNo") String payFlowNo);

	int update(PayFlowDO payFlowDO);

	int updateEnc(PayFlowDO payFlowDO);

	PayFlowDO findById(@Param("payFlowNo") String payFlowNo);

	PayFlowDO findByIdLock(@Param("payFlowNo") String payFlowNo);

	void batchSave(List<PayFlowDO> payFlowList);

	List<PayFlowDO> listBatchPayFlow(@Param("batchOrderId") String batchOrderId);

	void listUpdate(@Param("payFlowNos") List<PayFlowDO> list);

	PayFlowDO findByTradeOrder(@Param("tradeOrderNo") String tradeOrderId);

	PayFlowDO findByGateWayOrder(@Param("gatewayOrderNo") String gatewayOrderNo);

	PayFlowDO findFlow(PayFlowDO payFlowDO);

	List<UserBindCardDO> findAll();

	List<PayFlowDO> findUnHandleForSchedule(@Param("taskItemNum") Integer taskItemNum, @Param("taskItems") List<String> taskItems, @Param("fetchNum") Integer fetchNum);

	int updateHandleForSchedule(@Param("payFlowNo") String payFlowNo, @Param("oldStatus") List<Integer> oldStatus, @Param("newStatus") Integer newStatus, @Param("num") Integer num);

	List<PayFlowDO> findUserPayFlow(@Param("payFlowDO") PayFlowDO payFlowDO, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("userId") String userId,
			@Param("pageQuery") PageQuery pageQuery);

	Integer findUserPayFlowCount(@Param("payFlowDO") PayFlowDO payFlowDO, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("userId") String userId);

	Integer findUserPayFlowAmount(@Param("payFlowDO") PayFlowDO payFlowDO, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("userId") String userId);

	void batchUpdateHandleForSchedule(@Param("taskItemIds") List<String> taskItemIds, @Param("oldStatus") Integer oldStatus, @Param("newStatus") Integer newStatus, @Param("num") Integer num);

	Integer countByTradeOrderIds(@Param("originOrderId") String originOrderId, @Param("tradeOrderIds") List<String> tradeOrderIds);

	List<PayFlowDO> findByTradeOrderIds(@Param("originOrderId") String originOrderId, @Param("tradeOrderIds") List<String> tradeOrderIds, @Param("pageQuery") PageQuery pageQuery);

	int queryPlatformTradeFlowCount(@Param("originOrderNo")String originOrderNo,@Param("actNo") String actNo, @Param("businessType") String businessType, @Param("endDate") String endDate,
			@Param("startDate") String startDate, @Param("userType")Integer userType);

	List<PlatformTradeFlowDO> queryPlatformTradeFlow(@Param("originOrderNo")String originOrderNo,@Param("actNo") String actNo, @Param("businessType") String businessType, @Param("endDate") String endDate,
			@Param("startDate") String startDate, @Param("pageNo")Integer pageNo, @Param("pageSize")Integer pageSize, @Param("userType")Integer userType);
	
	Integer dumpCount(@Param("startTime") String startTime, @Param("endTime") String endTime);
	
	void deleteDumpCount(@Param("startTime") String startTime, @Param("endTime") String endTime);
	
	PayFlowDO findByPayOrderId(@Param("originOrderId") String originOrderId);

}